package com.lx.patterns.flyweight;

import java.util.HashMap;
import java.util.Map;

/**
 * @ClassName ShapeFactory
 * @Description: //todo
 * @Author: 落雪
 * @CreateDate: 2025/1/26 21:30
 * @UpdateUser: 落雪
 * @UpdateDate: 2025/1/26 21:30
 * @UpdateRemark:
 * @Version: 1.0
 */
public class ShapeFactory {

    public static ShapeFactory instance = new ShapeFactory();

    private static Map<String,AbstractBox> shapeMap;


    public  AbstractBox getShape(String key){
        return shapeMap.get(key);
    }

    private ShapeFactory() {
        shapeMap = new HashMap<>();
        shapeMap.put("I",new IBox());
        shapeMap.put("L",new LBox());
        shapeMap.put("O",new OBox());
    }


}
